#include "set.h"
#include "ui_set.h"
#include "qpainter.h"

Set::Set(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Set)
{
    ui->setupUi(this);
    ui->horizontalSlider->setValue(50);
}

Set::~Set()
{
    delete ui;
}

void Set::paintEvent(QPaintEvent *event)
{
    QPainter painters(this);
    //绘制背景
    //painters.setPen(Qt::darkBlue);//画笔颜色
    //painters.setBrush(Qt::black);//填充颜色
    //painters.drawRect(10,10,1080,1180);
    painters.drawPixmap(10,10,1080,1180,QPixmap(":/images/pictures/picture.jpg"));
//显示游戏开始和结束
QFont font1("Microsoft YaHei",12);
painters.setFont(font1);
painters.setPen(Qt::black);
painters.setBrush(Qt::black);
painters.drawText(200,160,QString::number(speed));
update();
}
void Set::on_horizontalSlider_valueChanged(int value)
{
    speed = value;
}
